window.onload = function(){
	var divNode = document.getElementById("div1");

function getDateAndTime(){
	var date = new Date();
	var year = date.getFullYear();
	var month = date.getMonth() + 1;
	var day = date.getDate();
	var time = date.toLocaleTimeString();
	var week = date.getDay();
	var str = year + "年" + month + "月" + day + "日" + "&nbsp;&nbsp;" + changeWeek(week)+ "&nbsp;&nbsp;" + time;
	divNode.innerHTML = str;
}
function changeWeek(w){
	switch(w){
		case 0:
			return "周日";
			break;
		case 1:
			return "周一";
			break;
		case 2:
			return "周二";
			break;
		case 3:
			return "周三";
			break;
		case 4:
			return "周四";
			break;
		case 5:
			return "周五";
			break;
		case 6:
			return "周六";
			break;
	}
}
setInterval(function(){
			getDateAndTime();},1000);
}